<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
    <title>会议通知</title>
    <link rel="stylesheet" href="../../../css/mui.min.css" />
    <script src="../../../js/mui.min.js"></script>
    <link rel="stylesheet" type="text/css" href="../../../css/app.css" />
    <link rel="stylesheet" href="../../../npl/css/vant.mini.css" />
    <script src="../../../js/jquery-3.6.0.min.js"></script>
    <script src="../../../js/flexible.js"></script>
    <script src="../../../js/vue.js"></script>
    <script src="../../../js/sm2.js"></script>
    <script src="../../../js/sm3.js"></script>
    <script src="../../../js/clipboard.js"></script>
    <script src="../../../npl/js/vant.mini.js"></script>
    <script src="../../../js/vconsole.min.js"></script>
    <script src="../../text.js" type="text/javascript"></script>

    <link rel="stylesheet" href="../css/github-markdown.css" />
    <link rel="stylesheet" href="../css/notice.css" />
    <link rel="stylesheet" href="../css/chooseDir.css" />
    

    <!-- <script src="../js/flexible.js"></script> -->
    <script src="../js/marked.min.js" type="text/javascript"></script>
    <script src="../js/turndown.js" type="text/javascript"></script>
    <script src="../js/util.js" type="text/javascript"></script>
    <script src="../js/stream.js"></script>
    <script src="../js/streamMsg.js"></script>
    <script src="../js/multiBtn.js"></script>
    <script src="../js/chooseDir.js"></script>

</head>

<body class="program-body">
    <div id="app" v-cloak>
        <multi-btn :changeable="changeMultiBtn"></multi-btn>
        <choose-dir ref="chooseDirRef" @choose-dir-upload="chooseDirUpload"></choose-dir>
        <van-image-preview v-model="modelImageShow" :images="modelImages" @change="onImageChange">
            <!-- <template v-slot:index>第{{ modelImageIndex+1 }}页</template> -->
        </van-image-preview>
        <div class="is-loading">
            <div class="curtain">
                <div class="loadingBgc">
                    <div class="loader"></div>
                </div>
            </div>
        </div>
        <div class="trainTickets program-main">
            <div class="header_tit">
                <van-nav-bar title="会议通知" :border=false left-arrow>
                    <template #left>
                        <div class="back_l active-brightness" @click="home()">
                            <img src="../../../image/left.png" alt="" />
                        </div>
                    </template>
                    <template #right>
                        <div v-if="1==currentStep" class="pre-next">
                            <div class="next active-brightness"  @click="showVoice()">
                                <img src="../images/write/voice-gen.png" alt=""/>
                            </div>
                        </div>
                    </template>
                </van-nav-bar>
            </div>
            <div class="program-main-body" ref="programMainRef">
                <!-- 生成大纲 -->
                <div v-if="currentStep == 1" class="step1">
                    <!-- 主题 -->
                    <div class="subject">
                        <div class="field-label">
                            <span class="tit_text">主题</span><span class="first_span_img">*</span>
                        </div>
                        <div class="subject-title">
                            <input @focus="handleInputFocus" @blur="handleInputBlur" class="subject-input" placeholder="示例：关于召开启动会的会议通知" v-model="form.topic" />
                        </div>
                    </div>
                    <!-- 模板 -->
                    <div class="model">
                        <div class="field-label">
                            <span class="tit_text">模板</span><span class="first_span_img">*</span>
                        </div>
                        <div class="m-scroll">
                            <div class="model-list active-brightness" v-for="item in modelList" :key="item.id" 
                                @click="selModel(item)">
                                <div :class="['m-list-item',curModelId == item.id ? 'm-selected':'']">
                                    <img v-if="curModelId == item.id ? true : false" 
                                        class="m-list-item-radio"  src="../images/write/xuanzhong.png" alt="">
                                    <img class="model-logo" :src="item.img" />
                                </div>
                                <div class="model-name">
                                    <span>{{ item.templateName }}</span>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- 时间 -->
                    <div class="subject">
                        <div class="field-label">
                            <span class="tit_text">时间</span><span class="first_span_img">*</span>
                        </div>
                        <div class="subject-title">
                            <input class="subject-input" readonly placeholder="示例：2024/09/19 10:00" v-model="form.date" @focus="showTimePicker()" />
                        </div>
                    </div>
                    <!-- 结束时间 -->
                    <div class="subject" v-if="6 != curModelId">
                        <div class="field-label">
                            <span class="tit_text">结束时间</span><span class="first_span_img">*</span>
                        </div>
                        <div class="subject-title">
                            <input class="subject-input" readonly placeholder="示例：2024/09/19 10:00" v-model="form.endDate" @focus="showTimePicker2()" />
                        </div>
                    </div>
                    <!-- 地点 -->
                    <div class="subject">
                        <div class="field-label">
                            <span class="tit_text">地点</span><span class="first_span_img">*</span>
                        </div>
                        <div class="subject-title">
                            <input @focus="handleInputFocus" @blur="handleInputBlur" class="subject-input" placeholder="示例：本部A座3楼会议室" v-model="form.location" />
                        </div>
                    </div>
                    <!-- 参会人员 -->
                    <div class="subject">
                        <div class="field-label">
                            <span class="tit_text">参会人员</span><span class="first_span_img">*</span>
                        </div>
                        <div class="subject-title">
                            <input @focus="handleInputFocus" @blur="handleInputBlur" class="subject-input" placeholder="示例：本部全体员工" v-model="form.participant" />
                        </div>
                    </div>
                    <!-- 会议议程 -->
                    <div class="subject">
                        <div class="field-label">
                            <span class="tit_text">会议议程</span><span class="first_span_img">*</span>
                        </div>
                        <div class="subject-title">
                            <textarea @focus="handleInputFocus" @blur="handleInputBlur" cols="2" class="area-input" placeholder="示例：1、主持人确认到场人员；2、介绍会议流程" v-model="form.agenda"></textarea>
                        </div>
                    </div>
                    <!-- 会议要求 -->
                    <div class="subject">
                        <div class="field-label">
                            <span class="tit_text">会议要求</span>
                        </div>
                        <div class="subject-title" style="margin-bottom: 10px;">
                            <textarea @focus="handleInputFocus" @blur="handleInputBlur" cols="1" class="area-input" placeholder="示例：1、着正装参加现场会议；2、线上参会人员进入会议时关闭麦克风" v-model="form.demand" ></textarea>
                        </div>
                    </div>
                    <!-- 生成通知按钮 -->
                    <div class="bottom">
                        <van-button v-if="bottomShow" class="submit-btn" @click="nextStep()">生成通知</van-button>
                    </div>
                </div>
                <!-- 会议通知已生成 -->
                <div v-if="currentStep == 2 && noticeHtmlContent != ''" class="outline">
                    <div class="outline-content active-brightness" ref="contentRef" @click="stopPop($event)">
                        <div class="markdown-body" ref="mdDiv" id="noticeContentDiv" v-html="noticeHtmlContent" :contenteditable="contentEditFlag"></div>
                    </div>
                    <div class="outline-btn">
                        <div class="outline-btn-item">
                            <div class="img-div-l">
                                <div class="img-div active-brightness" @click="createDoc">
                                    <img style="width: 0.8rem;" src="../images/write/gen-word.png" />
                                </div>
                            </div>
                            <div class="img-div active-brightness" @click="editNoticeContent($event)">
                                <img style="width: 1rem;" src="../images/write/bj.png" />
                            </div>
                        </div>
                    </div>
                </div>
                <!-- word和ppt结果 -->
                <div class="program-result" v-if="wordLoading">
                    <div class="program">
                        <div class="program-item active-brightness" v-if="wordResult.id" @click="preview(wordResult)">
                            <div class="program-item-left">
                                <img :src="'../images/word.png'" />
                            </div>
                            <div class="program-item-right">
                                <div class="right-title">{{ wordResult.fileName }}</div>
                                <div class="right-desc">WORD<span
                                        style="margin: 0 0.1rem 0 0.1rem;"></span>{{wordResult.fileSize}}</div>
                            </div>
                        </div>
                        <div class="program-item" v-else>
                            <div class="program-item-left">
                                <img :src="'../images/word.png'" />
                            </div>
                            <div class="program-item-right2">
                                <img src="../../../image/loading2.gif" />
                                <div class="loading-tip">文件正在生成中</div>
                            </div>
                        </div>
                        <van-divider
                            :style="{ color: '#999', borderColor: '#999', padding: '0 16px' }"></van-divider>
                        <div class="program-btn">
                            <div v-if="wordResult.id" class="img-div-l img-div active-brightness" @click="createPdf(wordResult)" >
                                <img :src="pptResult.id ? '../images/write/pdf-gray.png' : '../images/write/pdf-light.png'"
                                    />
                            </div>
                            <div class="img-div">
                                <div v-if="wordResult.id" class="img-div active-brightness" @click="sendMyEmail(wordResult)">
                                    <img src="../images/write/send-mail.png" />
                                </div>
                                <div v-if="wordResult.id" class="img-div active-brightness" @click="syncToInner(wordResult)" >
                                    <img src="../images/write/sync.png" />
                                </div>
                                <div v-if="wordResult.id" class="img-div active-brightness" @click="shareIgw(wordResult)" >
                                    <img src="../images/write/share.png" />
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="program" v-if="pptLoading">
                        <div class="program-item active-brightness" v-if="wordResult.id && pptResult.id" @click="preview(pptResult)">
                            <div class="program-item-left">
                                <img :src="'../images/pdf.png'" />
                            </div>
                            <div class="program-item-right">
                                <div class="right-title">{{ pptResult.fileName }}</div>
                                <div class="right-desc">PDF<span
                                        style="margin: 0 0.1rem 0 0.1rem;"></span>{{pptResult.fileSize}}</div>
                            </div>
                        </div>
                        <div class="program-item" v-if="wordResult.id && !pptResult.id">
                            <div class="program-item-left">
                                <img :src="'../images/pdf.png'" />
                            </div>
                            <div class="program-item-right2">
                                <img src="../../../image/loading2.gif" />
                                <div class="loading-tip">文件正在生成中</div>
                            </div>
                        </div>
                        <van-divider
                            :style="{ color: '#999', borderColor: '#999', padding: '0 16px' }"></van-divider>
                        <div class="program-btn">
                            <div class="img-div-l"></div>
                            <div class="img-div">
                                <div v-if="pptResult.id" class="img-div active-brightness" @click="sendMyEmail(pptResult)">
                                    <img src="../images/write/send-mail.png" />
                                </div>
                                <div v-if="pptResult.id" class="img-div active-brightness" @click="syncToInner(pptResult)">
                                    <img src="../images/write/sync.png" />
                                </div>
                                <div v-if="pptResult.id" class="img-div active-brightness" @click="shareIgw(pptResult)">
                                    <img src="../images/write/share.png" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- 语音录入框 -->
                <van-dialog v-model="showVoiceDialog" :show-confirm-button="false" close-on-click-overlay>
                    <template #title>
                        <div class="">
                        <span class="dialog_title">语音助手</span>
                        <van-icon class="close active-brightness" @click="closeVoiceDialog()" name="cross">
                        </van-icon>
                        </div>
                    </template>
                    
                    <template #default>
                        <van-divider style="width:100%;"></van-divider>
                        <div class="voice_dialog">
                            <div class="w100">
                                <textarea id="voiceContent" cols="5" :readonly="1==voiceType" class="voice-input" placeholder="请说出会议主题、时间、地点、参会人员、会议议程、会议要求" v-model="voiceContent"></textarea>
                            </div>
                            <div class="notice-play-btn" 
                                    @touchstart="startTalk(1, $event)"
                                    @touchend="stopTalk(1)">
                                <img class="" :src="voiceType==1 ? '../images/write/notice-dis.png' : '../images/write/notice-ac.png'" 
                                    />
                            </div>
                            <div class="w100 notice-play-btn" >
                                <img src="../images/write/voice-wav.png" v-if="voiceType == 1"/>
                            </div>
                        </div>
                        <van-divider style="width:100%;"></van-divider>
                        <div class="w100 notice-play-btn">
                            <van-button :class="['auto-fill-btn', voiceContent ? 'can-click' : '']" :disabled="!voiceContent && !voicing" @click="autoFillForm()">自动填充</van-button>
                        </div>
                    </template>
                </van-dialog>
            </div>
            <!-- ppt模板选择 -->
            <van-action-sheet  class="ppt-model-sheet" v-model:show="showPptDialog" title="PPT辅助生成" closeable>
                <div class="ppt-subject" >
                    <div class="field-label">
                        <span class="tit_text">文件标题</span><span class="first_span_img">*</span>
                    </div>
                    <div class="subject-title">
                        <input class="subject-input" placeholder="示例：xxxx项目" v-model="pptForm.title" />
                    </div>
                </div>
                <div class="model-area">
                    <div class="field-label" style="margin-top: 0.2rem;">
                        <span class="tit_text">选择主题</span><span class="first_span_img">*</span>
                    </div>
                    <div class="gray_text">专用模板</div>
                    <div class="ppt-item-list">
                        <div v-for="item in pptDedModelList" :key="item.id" class="ppt-item active-brightness" @click="selPptModel(item)">
                            <img :src="item.coverUrl" :class="[pptForm.modelId == item.id ? 'ppt-model-selected':'']"/>
                        </div>
                    </div>
                    <div class="gray_text" style="margin-top: 0.2rem;">通用模板</div>
                    <div v-for="item in pptComModelList" :key="item.id" class="ppt-item active-brightness"  @click="selPptModel(item)">
                        <img :src="item.coverUrl" :class="[pptForm.modelId == item.id ? 'ppt-model-selected':'']"/>
                    </div>
                </div>
                <div class="ppt-model-bottom">
                    <van-button class="ppt-submit-btn" @click="createPpt()">PPT辅助生成</van-button>
                </div>
            </van-action-sheet>
            <!-- 会议时间选择 -->
             <van-action-sheet v-model:show="showTimeFlag" >
                <van-datetime-picker
                    v-model="selDate"
                    type="datetime"
                    title="选择会议时间"
                    :min-date="minDate"
                    :max-date="maxDate"
                    :formatter="timerFormatter"
                    @confirm="confirmDate()"
                    @cancel ="cancelDate()"
                    />
             </van-action-sheet>
             <!-- 会议结束时间选择 -->
             <van-action-sheet v-model:show="showTimeFlag2" >
                <van-datetime-picker
                    v-model="selDate2"
                    type="datetime"
                    title="选择会议结束时间"
                    :min-date="minDate"
                    :max-date="maxDate"
                    :formatter="timerFormatter"
                    @confirm="confirmDate2()"
                    @cancel ="cancelDate2()"
                    />
             </van-action-sheet>
        </div>
    </div>

    <script src="../js/meetingNotice.js"></script>
</body>

</html>